﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Cart>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <%: Html.Partial("Sidebar") %>
    <div id="main">
        <div class="main-block">
            <h2 class="title">
                <%:"Checkout".Localize() %></h2>
            <div class="main-block-content cart-content clearfix">
                <div class="order-progress">
                    <ul>
                        <li><a href="<%= this.ViewData["CartLinks"].Bind("Index") %>">
                            <%:"Cart".Localize() %></a></li>
                        <li><a>
                            <%:"Address".Localize() %></a></li>
                        <li><a href="<%= this.ViewData["CartLinks"].Bind("Checkout") %>">
                            <%:"Shipping & Payment".Localize() %></a></li>
                        <li class="active"><a>
                            <%:"Confirm".Localize() %></a></li>
                    </ul>
                </div>
                <div class="cart-block confirm-block">
                    <div>
                        <dl>
                            <dt>
                                <%:"Shipping Method".Localize() %></dt>
                            <dd>
                                <%: this.ViewData["ShippingInfo"].Bind("ShippingName")%></dd>
                        </dl>
                        <dl>
                            <dt>
                                <%:"Shipping Address".Localize() %></dt>
                            <dd>
                                <p>
                                    <%: this.ViewData["ShippingInfo"].Bind("FirstName")%>
                                    <%: this.ViewData["ShippingInfo"].Bind("LastName")%></p>
                                <p>
                                    <%: this.ViewData["ShippingInfo"].Bind("City")%>
                                    <%: this.ViewData["ShippingInfo"].Bind("State")%>
                                    <%: this.ViewData["ShippingInfo"].Bind("Country")%>
                                </p>
                                <p>
                                    <%: this.ViewData["ShippingInfo"].Bind("Address1")%>
                                </p>
                                <%: this.ViewData["ShippingInfo"].Bind("Address2")%>
                                <p>
                                    <%: this.ViewData["ShippingInfo"].Bind("Postcode")%></p>
                                <p>
                                    <%: this.ViewData["ShippingInfo"].Bind("Phone")%>
                                </p>
                            </dd>
                        </dl>
                    </div>
                    <div>
                        <dl>
                            <dt>
                                <%:"Payment Method".Localize() %></dt>
                            <dd>
                                <%: this.ViewData["PaymentInfo"].Bind("Payment")%></dd>
                        </dl>
                        <dl>
                            <dt>
                                <%:"Payment Address".Localize() %></dt>
                            <dd>
                                <p>
                                    <%: this.ViewData["PaymentInfo"].Bind("InvoiceFirstName")%>
                                    <%: this.ViewData["PaymentInfo"].Bind("InvoiceLastName")%></p>
                                <p>
                                    <%: this.ViewData["PaymentInfo"].Bind("InvoiceCity")%>
                                    <%: this.ViewData["PaymentInfo"].Bind("InvoiceState")%>
                                    <%: this.ViewData["PaymentInfo"].Bind("InvoiceCountry")%>
                                </p>
                                <p>
                                    <%: this.ViewData["PaymentInfo"].Bind("InvoiceAddress1")%>
                                </p>
                                <%: this.ViewData["PaymentInfo"].Bind("InvoiceAddress2")%>
                                <p>
                                    <%: this.ViewData["PaymentInfo"].Bind("InvoicePostcode")%></p>
                                <p>
                                    <%: this.ViewData["PaymentInfo"].Bind("InvoicePhone")%>
                                </p>
                            </dd>
                        </dl>
                    </div>
                </div>
                <form action="<%= this.ViewData["CartLinks"].Bind("Pay") %>" method="post">
                <div class="cart-block">
                    <table>
                        <thead>
                            <tr>
                                <th>
                                    <%: "Image".Localize() %>
                                </th>
                                <th>
                                    <%: "Name".Localize() %>
                                </th>
                                <th>
                                    <%: "SKU".Localize() %>
                                </th>
                                <th>
                                    <%: "Unit Price".Localize() %>
                                </th>
                                <th>
                                    <%: "Quantity".Localize() %>
                                </th>
                                <th>
                                    <%: "SubTotal".Localize() %>
                                </th>
                                <th>
                                    <%: "Discount".Localize() %>
                                </th>
                                <th>
                                    <%: "Total".Localize() %>
                                </th>
                                <th>
                                    <%: "Remove".Localize() %>
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <% foreach (var item in (IEnumerable)this.ViewBag.CartItems)
                               {
                       
                            %>
                            <tr>
                                <td>
                                    <img src="<%= item.Bind("Image") %>" alt="" />
                                </td>
                                <td>
                                    <a href="<%= item.Bind("ProductUrl") %>">
                                        <%= item.Bind("ProductName") %></a>
                                </td>
                                <td>
                                    <%= item.Bind("Sku")%>
                                </td>
                                <td>
                                    <%= item.Bind("UnitPrice") %>
                                </td>
                                <td class="quantity">
                                    <%= item.Bind("Quantity")%>
                                </td>
                                <td>
                                    <%= item.Bind("SubTotal") %>
                                </td>
                                <td>
                                    <%= item.Bind("Discount") %>
                                </td>
                                <td>
                                    <%= item.Bind("Total") %>
                                </td>
                                <td>
                                    <a class="remove" href="<%= item.Bind("RemoveUrl") %>">
                                        <%:"Remove".Localize() %></a>
                                </td>
                            </tr>
                            <%
                               } %>
                        </tbody>
                    </table>
                    <div class="total">
                        <div class="left">
                        </div>
                        <div class="right">
                            <dl>
                                <dt>
                                    <%:"SubTotal:".Localize() %></dt>
                                <dd>
                                    <%: this.Model.SubTotal.ToString("c") %></dd>
                            </dl>
                            <dl>
                                <dt>
                                    <%: "Total Discount:".Localize() %></dt>
                                <dd>
                                    <%: this.Model.TotalDiscount.ToString("c")
                                    %></dd>
                            </dl>
                            <dl>
                                <dt>
                                    <%: "Total Tax Cost :".Localize() %></dt>
                                <dd>
                                    <%: this.Model.TaxCost.ToString("c")
                                    %></dd>
                            </dl>
                            <dl>
                                <dt>
                                    <%: "ShippingCost:".Localize() %></dt>
                                <dd>
                                    <%: this.Model.ShippingCost.ToString("c")
                                    %></dd>
                            </dl>
                            <dl>
                                <dt>
                                    <%: "PaymentMethodCost:".Localize() %></dt>
                                <dd>
                                    <%: this.Model.PaymentMethodCost.ToString("c")%></dd>
                            </dl>
                            <dl>
                                <dt>
                                    <%: "Total:".Localize() %></dt>
                                <dd>
                                    <%: this.Model.Total.ToString("c")
                                    %></dd>
                            </dl>
                        </div>
                    </div>
                </div>
                <div class="buttons">
                    <a class="button left" href="<%= this.ViewData["CartLinks"].Bind("Payment") %>"><span>
                        <%:"« Back".Localize() %></span></a> <a class="button right submit-link" href="#"><span>
                            <%:"Pay Now »".Localize() %></span></a>
                </div>
                </form>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="JSContent" runat="server">
    <script type="text/javascript">
        $(function () {
            $(".submit-link").click(function (e) {
                e.preventDefault();
                $(this).parents("form:first").submit();
                return false;
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Breadcrumb" runat="server">
</asp:Content>
